package com.eastfair.venuebooking.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.eastfair.core.base.entity.Entity;
import java.time.LocalDate;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.Map;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;
import lombok.experimental.Accessors;
import static com.eastfair.core.utils.DateUtils.DEFAULT_DATE_TIME_FORMAT;
import com.eastfair.annotation.model.EchoVO;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 跟进记录表
 * </p>
 *
 * @author dq
 * @since 2022-06-25
 */
@Data
@NoArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("vb_follow_record")
@ApiModel(value = "FollowRecord", description = "跟进记录表")
@AllArgsConstructor
public class FollowRecord extends Entity<Long> implements EchoVO {

    private static final long serialVersionUID = 1L;
    @TableField(exist = false)
    private Map<String, Object> echoMap = new HashMap<>();
    /**
     * 是否启用：1是；0否
     */
    @ApiModelProperty(value = "是否启用：1是；0否")
    @TableField(value = "is_enabled")
    @Excel(name = "是否启用：1是；0否")
    private Integer isEnabled;

    /**
     * 是否删除：1是；0否
     */
    @ApiModelProperty(value = "是否删除：1是；0否")
    @TableField(value = "is_deleted")
    @Excel(name = "是否删除：1是；0否")
    private Integer isDeleted;

    /**
     * 项目id
     */
    @ApiModelProperty(value = "项目id")
    @TableField(value = "project_id")
    @Excel(name = "项目id")
    private Long projectId;

    /**
     * 子系统id
     */
    @ApiModelProperty(value = "子系统id")
    @TableField(value = "subsystem_id")
    @Excel(name = "子系统id")
    private Long subsystemId;

    /**
     * 租户id
     */
    @ApiModelProperty(value = "租户id")
    @TableField(value = "tenant_id")
    @Excel(name = "租户id")
    private Long tenantId;

    /**
     * 跟进类型，数据字典
     */
    @ApiModelProperty(value = "跟进类型，数据字典")
    @Size(max = 64, message = "跟进类型，数据字典长度不能超过64")
    @TableField(value = "follow_type", condition = LIKE)
    @Excel(name = "跟进类型，数据字典")
    private String followType;

    /**
     * 跟进内容
     */
    @ApiModelProperty(value = "跟进内容")
    @Size(max = 255, message = "跟进内容长度不能超过255")
    @TableField(value = "content", condition = LIKE)
    @Excel(name = "跟进内容")
    private String content;

    /**
     * 跟进用户id
     */
    @ApiModelProperty(value = "跟进用户id")
    @TableField(value = "follow_user_id")
    @Excel(name = "跟进用户id")
    private Long followUserId;

    /**
     * 跟进日期
     */
    @ApiModelProperty(value = "跟进日期")
    @TableField(value = "follow_date")
    @Excel(name = "跟进日期", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDate followDate;

    /**
     * 跟进时间
     */
    @ApiModelProperty(value = "跟进时间")
    @TableField(value = "follow_date_time")
    @Excel(name = "跟进时间", format = DEFAULT_DATE_TIME_FORMAT, width = 20)
    private LocalDateTime followDateTime;

    /**
     * 跟进记录的类型，枚举，1.跟进客户，2.跟进线索，3.跟进商机
     */
    @ApiModelProperty(value = "跟进记录的类型，枚举，1.跟进客户，2.跟进线索，3.跟进商机")
    @Size(max = 20, message = "跟进记录的类型，枚举，1.跟进客户，2.跟进线索，3.跟进商机长度不能超过20")
    @TableField(value = "follow_record_type", condition = LIKE)
    @Excel(name = "跟进记录的类型，枚举，1.跟进客户，2.跟进线索，3.跟进商机")
    private String followRecordType;

    /**
     * 客户id
     */
    @ApiModelProperty(value = "客户id")
    @TableField(value = "customer_id")
    @Excel(name = "客户id")
    private Long customerId;

    /**
     * 客户名称
     */
    @ApiModelProperty(value = "客户名称")
    @Size(max = 64, message = "客户名称长度不能超过64")
    @TableField(value = "customer_name", condition = LIKE)
    @Excel(name = "客户名称")
    private String customerName;

    /**
     * 客户状态，数据字典
     */
    @ApiModelProperty(value = "客户状态，数据字典")
    @Size(max = 64, message = "客户状态，数据字典长度不能超过64")
    @TableField(value = "customer_status", condition = LIKE)
    @Excel(name = "客户状态，数据字典")
    private String customerStatus;

    /**
     * 联系人id
     */
    @ApiModelProperty(value = "联系人id")
    @TableField(value = "contact_id")
    @Excel(name = "联系人id")
    private Long contactId;

    /**
     * 联系人名称
     */
    @ApiModelProperty(value = "联系人名称")
    @Size(max = 64, message = "联系人名称长度不能超过64")
    @TableField(value = "contact_name", condition = LIKE)
    @Excel(name = "联系人名称")
    private String contactName;

    /**
     * 线索id
     */
    @ApiModelProperty(value = "线索id")
    @TableField(value = "clue_id")
    @Excel(name = "线索id")
    private Long clueId;

    /**
     * 线索名称
     */
    @ApiModelProperty(value = "线索名称")
    @Size(max = 64, message = "线索名称长度不能超过64")
    @TableField(value = "clue_name", condition = LIKE)
    @Excel(name = "线索名称")
    private String clueName;

    /**
     * 线索状态
     */
    @ApiModelProperty(value = "线索状态")
    @Size(max = 64, message = "线索状态长度不能超过64")
    @TableField(value = "clue_status", condition = LIKE)
    @Excel(name = "线索状态")
    private String clueStatus;

    /**
     * 商机id
     */
    @ApiModelProperty(value = "商机id")
    @TableField(value = "business_opportunity_id")
    @Excel(name = "商机id")
    private Long businessOpportunityId;

    /**
     * 商机名称
     */
    @ApiModelProperty(value = "商机名称")
    @Size(max = 64, message = "商机名称长度不能超过64")
    @TableField(value = "business_opportunity_name", condition = LIKE)
    @Excel(name = "商机名称")
    private String businessOpportunityName;

    /**
     * 商机阶段，数据字段
     */
    @ApiModelProperty(value = "商机阶段，数据字段")
    @Size(max = 64, message = "商机阶段，数据字段长度不能超过64")
    @TableField(value = "business_opportunity_stage", condition = LIKE)
    @Excel(name = "商机阶段，数据字段")
    private String businessOpportunityStage;

    /**
     * 合同id
     */
    @ApiModelProperty(value = "合同id")
    @TableField(value = "contract_manage_id")
    @Excel(name = "合同id")
    private Long contractManageId;

    /**
     * 合同名称
     */
    @ApiModelProperty(value = "合同名称")
    @Size(max = 255, message = "合同名称长度不能超过255")
    @TableField(value = "contract_manage_name", condition = LIKE)
    @Excel(name = "合同名称")
    private String contractManageName;

    @ApiModelProperty(value = "")
    @TableField(value = "follow_plan_id")
    @Excel(name = "")
    private Integer followPlanId;


    @ApiModelProperty(value = "同步状态")
    @TableField(value = "sync_state")
    @Excel(name = "同步状态")
    private Integer syncState;


    @ApiModelProperty(value = "同步批次")
    @TableField(value = "syn_trace_id")
    @Excel(name = "同步批次")
    private Integer synTraceId;


    @Builder
    public FollowRecord(Long id, Long createdBy, LocalDateTime createTime, Long updatedBy, LocalDateTime updateTime, 
                    Integer isEnabled, Integer isDeleted, Long projectId, Long subsystemId, Long tenantId, 
                    String followType, String content, Long followUserId, LocalDate followDate, LocalDateTime followDateTime, String followRecordType, 
                    Long customerId, String customerName, String customerStatus, Long contactId, String contactName, Long clueId, 
                    String clueName, String clueStatus, Long businessOpportunityId, String businessOpportunityName, String businessOpportunityStage, Long contractManageId, 
                    String contractManageName, Integer followPlanId) {
        this.id = id;
        this.createdBy = createdBy;
        this.createTime = createTime;
        this.updatedBy = updatedBy;
        this.updateTime = updateTime;
        this.isEnabled = isEnabled;
        this.isDeleted = isDeleted;
        this.projectId = projectId;
        this.subsystemId = subsystemId;
        this.tenantId = tenantId;
        this.followType = followType;
        this.content = content;
        this.followUserId = followUserId;
        this.followDate = followDate;
        this.followDateTime = followDateTime;
        this.followRecordType = followRecordType;
        this.customerId = customerId;
        this.customerName = customerName;
        this.customerStatus = customerStatus;
        this.contactId = contactId;
        this.contactName = contactName;
        this.clueId = clueId;
        this.clueName = clueName;
        this.clueStatus = clueStatus;
        this.businessOpportunityId = businessOpportunityId;
        this.businessOpportunityName = businessOpportunityName;
        this.businessOpportunityStage = businessOpportunityStage;
        this.contractManageId = contractManageId;
        this.contractManageName = contractManageName;
        this.followPlanId = followPlanId;
    }

}
